<html><head><title>MoveElement</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">MoveElement()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#3A3966"><b>MoveElement</b></font>(List(), Location [, *RelativeElement])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Moves the current element of the specified list to a different position in the list. The moved element 
remains the current element of the list. This is a fast operation because the element data itself is not moved to 
change the location in the list. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>List()</i></td>
<td width="90%"> 
The name of your list variable, created with the <a href="../reference/newlist.html">NewList</a> function. 
You must include the brackets after the list name. 

</td></tr>
<tr><td><i>Location</i></td>
<td> 
Location where to move the current element. This can be one of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_List_First</font> : Move the element to the beginning of the list
  <font color="#924B72">#PB_List_Last</font>  : Move the element to the end of the list
  <font color="#924B72">#PB_List_Before</font>: Move the element before the *RelativeElement
  <font color="#924B72">#PB_List_After</font> : Move the element after the *RelativeElement
</font></pre>

</td></tr>
<tr><td><i>*RelativeElement (optional)</i></td>
<td> 
The address of another element in relation to which the current element should be moved. This 
parameter is required when the 'Location' parameter is <font color="#924B72">#PB_List_Before</font> or <font color="#924B72">#PB_List_After</font>. 
You can get this address from an element by using the @ operator on the list name. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Numbers</font>()
  
  <b><font color="#3A3966">For</font></b> k=0 <b><font color="#3A3966">To</font></b> 10
<font color="#3A3966">    AddElement</font>(<font color="#3A3966">Numbers</font>())
<font color="#3A3966">    Numbers</font>() = k
  <b><font color="#3A3966">Next</font></b>
  
<font color="#3A3966">  SelectElement</font>(<font color="#3A3966">Numbers</font>(), 5) 
  *Relative = @Numbers()                             <font color="#3A3966">; get address of element 5</font>
  
<font color="#3A3966">  SelectElement</font>(<font color="#3A3966">Numbers</font>(), 0)
<font color="#3A3966">  MoveElement</font>(<font color="#3A3966">Numbers</font>(), <font color="#924B72">#PB_List_After</font>, *Relative)  <font color="#3A3966">; move after element 5</font>
    
<font color="#3A3966">  SelectElement</font>(<font color="#3A3966">Numbers</font>(), 10)
<font color="#3A3966">  MoveElement</font>(<font color="#3A3966">Numbers</font>(), <font color="#924B72">#PB_List_First</font>)             <font color="#3A3966">; move to the beginning</font>
    
  <font color="#3A3966">; Result</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">ForEach</font></b> <font color="#3A3966">Numbers</font>()
    <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">Numbers</font>()
  <b><font color="#3A3966">Next</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="swapelements.html">SwapElements()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=mergelists.html>MergeLists()</a> - <a href="index.html">List Index</a> - <a href="nextelement.html">NextElement()</a> -><br><br>

</body></html>